package cn.com.exlibris.util;

import java.io.File;
import java.io.FilenameFilter;


public class FileListFilter implements FilenameFilter {
	private String extension;

	public FileListFilter(String extension) {
		this.extension = extension;
	}

	public boolean accept(File directory, String filename) {
		boolean fileOk = true;
		if (extension != null) {
			fileOk &= filename.endsWith('.' + extension);
		}
		return fileOk;
	}
}